package simpleServlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jCharts.chartData.ChartDataException;
import org.jCharts.properties.PropertyException;

public class XYServlet extends HttpServlet {
	/**********************************************************************************************
	 *
	 **********************************************************************************************/
	public void init(){
	}


	/**********************************************************************************************
	 *
	 **********************************************************************************************/
	public void service( HttpServletRequest req, HttpServletResponse response ) throws ServletException, IOException{
		int sizeLargeur = 700;
		int sizeHauteur = 350;
		try {
			ChartServlet.addXYChartFonctionPartitionForQValue(req, sizeLargeur, sizeHauteur);
		} catch (PropertyException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ChartDataException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		this.getServletContext().getRequestDispatcher( "/xy.jsp" ).forward( req, response );
	}
}
